﻿<UserControl x:Class="OSChina.Controls.ActiveListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:tileEffect="clr-namespace:WP7_ControlsLib.Controls;assembly=WP7_ControlsLib"
             tileEffect:TiltEffect.IsTiltEnabled="True"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <DataTemplate x:Key="template_Normal">
            <Grid Margin="0,18,0,22">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="70" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <!-- 头像 -->
                <Image Name="img" Width="50" Height="50" VerticalAlignment="Top" Margin="0,7,6,0" Source="{Binding portrait,Mode=OneTime}" MouseLeftButtonUp="img_MouseLeftButtonUp" />
                <StackPanel Grid.Column="1" >
                    <TextBlock  Loaded="TextBlock_Loaded" Width="390" TextWrapping="Wrap" />
                    <Image Name="imgTweet" Loaded="imgTweet_Loaded"  Source="{Binding tweetImage, Mode=OneTime}" HorizontalAlignment="Left" Margin="0,16,0,2" MaxHeight="240" MaxWidth="240" Stretch="None"  />
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="template_User">
            <Grid Margin="0,18,0,24">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="70" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <!-- 头像 -->
                <Image Name="img" Width="50" Height="50" VerticalAlignment="Top" Margin="0,7,6,0" Source="{Binding portrait,Mode=OneTime}" MouseLeftButtonUp="img_MouseLeftButtonUp" />
                <StackPanel Grid.Column="1" >
                    <TextBlock  Loaded="TextBlock_Loaded" Width="350" TextWrapping="Wrap" />
                    <Image Name="imgTweet" Loaded="imgTweet_Loaded" Source="{Binding tweetImage, Mode=OneTime}" HorizontalAlignment="Left" Margin="0,16,0,2" MaxHeight="240" MaxWidth="240" Stretch="None"  />
                </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot">
        <ListBox Name="list_Activies" ItemTemplate="{StaticResource template_Normal}" SelectionChanged="list_Activies_SelectionChanged">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel CacheMode="BitmapCache"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </Grid>
</UserControl>
